
<template>
  <div>
<h1>Vue基本元素--html模版语法（{{}}+指令）</h1>
姓名:<input type="text" v-model="userName"/><br>
密码：<input type="password" v-model="userPwd"/><br>
<input type="button" value="改变num的值" @click="login"/>
  </div>
</template>

<script setup lang="ts">

import { reactive,toRefs } from 'vue';

let data:any=reactive({

  userName:'',
  userPwd:'',
})

let {userName,userPwd}=toRefs(data)

const login=()=>{
  alert("姓名"+userName.value+"密码"+userPwd.value)
}

</script>

<style scoped>

</style>